﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;

namespace Mpfr.Structs
{
  public unsafe class mpf_t : IDisposable
  {
    internal __mpf_struct* mpf_ptr;

    public mpf_t()
    {
      mpf_ptr = (__mpf_struct*)Marshal.AllocHGlobal(sizeof(__mpf_struct));
    }

    ~mpf_t()
    {
      Dispose();
    }

    public void Dispose()
    {
      if (mpf_ptr != null)
      {
        Marshal.FreeHGlobal((IntPtr)mpf_ptr);
        mpf_ptr = null;
      }
    }
  }
}
